#ifndef SAVE_H
#define SAVE_H

#include <QThread>
#include <QDebug>
#include <m3api/xiApi.h>
#include <QFile>
#include <QTextStream>
#include <QProcess>
#include <QDateTime>
#include "/usr/include/gdal/gdal_priv.h"



#define IMAGE_WIDTH  2048
#define IMAGE_HEIGHT 1088
#define PATTERN_WIDTH 5
#define FILTER_WIDTH  2045
#define FILTER_HEIGHT 1080
#define WAVEBAND_NUMBER (FILTER_WIDTH*FILTER_HEIGHT/(PATTERN_WIDTH*PATTERN_WIDTH))
#define OFFSET_X 0
#define OFFSET_Y 3
#define FILEPATH "/media/nvidia/34B84591B8455292/"
#define PHOTOPATH "/media/nvidia/34B84591B8455292/newgeo.tif"


class Save : public QThread
{
    Q_OBJECT
public:
    Save(QObject *parent = 0);

protected:
    void run();

private slots:
    void proFinishSlot(int exitCode);
    void proCpFinishSlot(int exitCode);
    void proSlot();

signals:
    void proSignal();
    void saveokSignal();

private:
    QProcess *pro;
    QProcess *proCp;

    unsigned short waveBand01[WAVEBAND_NUMBER];
    unsigned short waveBand02[WAVEBAND_NUMBER];
    unsigned short waveBand03[WAVEBAND_NUMBER];
    unsigned short waveBand04[WAVEBAND_NUMBER];
    unsigned short waveBand05[WAVEBAND_NUMBER];
    unsigned short waveBand06[WAVEBAND_NUMBER];
    unsigned short waveBand07[WAVEBAND_NUMBER];
    unsigned short waveBand08[WAVEBAND_NUMBER];
    unsigned short waveBand09[WAVEBAND_NUMBER];
    unsigned short waveBand10[WAVEBAND_NUMBER];
    unsigned short waveBand11[WAVEBAND_NUMBER];
    unsigned short waveBand12[WAVEBAND_NUMBER];
    unsigned short waveBand13[WAVEBAND_NUMBER];
    unsigned short waveBand14[WAVEBAND_NUMBER];
    unsigned short waveBand15[WAVEBAND_NUMBER];
    unsigned short waveBand16[WAVEBAND_NUMBER];
    unsigned short waveBand17[WAVEBAND_NUMBER];
    unsigned short waveBand18[WAVEBAND_NUMBER];
    unsigned short waveBand19[WAVEBAND_NUMBER];
    unsigned short waveBand20[WAVEBAND_NUMBER];
    unsigned short waveBand21[WAVEBAND_NUMBER];
    unsigned short waveBand22[WAVEBAND_NUMBER];
    unsigned short waveBand23[WAVEBAND_NUMBER];
    unsigned short waveBand24[WAVEBAND_NUMBER];
    unsigned short waveBand25[WAVEBAND_NUMBER];
};

#endif // SAVE_H
